//
//  DuoBaoXinxiViewController.m
//  1243
//
//  Created by apple on 16/7/7.
//  Copyright © 2016年 1243. All rights reserved.
//

#import "DuoBaoXinxiViewController.h"
#import "DuoBaoView.h"
@interface DuoBaoXinxiViewController ()

@end

@implementation DuoBaoXinxiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createUI];
    [self createBotton];
    
}

- (void)createUI {
    DuoBaoView *view = [[DuoBaoView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT - 124)];
    [self.view addSubview:view];
}

- (void)createBotton {
    UIButton *but = [UIButton buttonWithType:UIButtonTypeCustom];
    but.frame = CGRectMake(0, HEIGHT - 124, WIDTH/2, 60);
    [but setTitle:@"联系卖家" forState:UIControlStateNormal];
    but.backgroundColor = [UIColor colorWithRed:45/255.0 green:86/255.0 blue:226/255.0 alpha:1];
    [but addTarget:self action:@selector(callPhone:) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *but1 = [UIButton buttonWithType:UIButtonTypeCustom];
    but1.frame = CGRectMake(WIDTH/2, HEIGHT - 124, WIDTH/2, 60);
    [but1 setTitle:@"继续夺宝" forState:UIControlStateNormal];
    but1.backgroundColor = [UIColor colorWithRed:243/255.0 green:114/255.0 blue:33/255.0 alpha:1];
    [but1 addTarget:self action:@selector(jumpToMain:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:but];
    [self.view addSubview:but1];
}

- (void)jumpToMain:(UIButton *)sender {
    [self.navigationController popViewControllerAnimated:YES];
    
}

- (void)callPhone:(UIButton *)sender {
    
    NSURL *url = [NSURL URLWithString:@"telprompt://10010"];
    [[UIApplication sharedApplication] openURL:url];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
